//
//  NYInfluenceManager.m
//  Nooryes
//
//  Created by baken on 2020/2/25.
//  Copyright © 2020 MyApp. All rights reserved.
//

#import "NYInfluenceManager.h"
#import "NYCategoryModel.h"
#import "NYArticleListModel.h"

@implementation NYInfluenceManager

+ (void)getCategoryWithType:(NSString *)type andCompletionHandle:(void (^)(NYCategoryModel *model, NSError *error))complete{
    [self GET:[NSString stringWithFormat:@"%@%@?type=%@",Api_URL,kGetInfluenceCategory,type]
   parameters:nil
completionHandler:^(id responseObj, NSError *error) {
        NYCategoryModel *model = [NYCategoryModel mj_objectWithKeyValues:responseObj];
        if (model.code != 0) {
            error = [self createError:model.msg];
        }
        complete(model,error);
    }];
}


+ (void)getInfluenceListWithPage:(NSString *)page andTopicID:(NSString *)ID andCompletionHandle:(void (^)(NYArticleListModel *model, NSError *error))complete{
    [self GET:[NSString stringWithFormat:@"%@%@?p=%@&classid=%@",Api_URL,kGetInfluenceList,page,ID]
   parameters:nil
completionHandler:^(id responseObj, NSError *error) {
        NYArticleListModel *model = [NYArticleListModel mj_objectWithKeyValues:responseObj];
        if (model.code != 0) {
            error = [self createError:model.msg];
        }
        complete(model,error);
    }];
}
@end
